<div align="center">
<form name="form_admin" method="post" action="<?php echo formEditAction()?>" >
    <input type="hidden" name="id" value="<?php echo $id?>" />
	<table style="width:500px">
		<tr>
			<td>Group Name</td>
			<td>
            <input type="text" name="GroupName" value="<?php echo $group_permission['cGroupName']?>" class="short"
            style="width:300px"/></td>
		</tr>
		<tr>
			<td><?php echo _DESCRIPTION?></td>
			<td>
				<textarea  name="Description" id="Description"
                class="noeditor"><?php echo $group_permission['cDescription']?></textarea>
			</td>
		</tr>
		</table>
		<table border="0" cellpadding="0" cellspacing="1" id="tblsort" style="width:500px">
		  <tr  class="headtb" nodrag=true>
			<td width="50" nowrap="nowrap" style="padding-left:5">Module</td>
			<td width="50"><a href="#all" onclick="checkall('add',this)">Add</a></td>
            <td width="50"><a href="#all" onclick="checkall('edit',this)">Edit</a></td>
            <td width="50"><a href="#all" onclick="checkall('del',this)">Delete</a></td>
		  </tr>
		 <?php
		 $j=0;
         $list_modules =$menu->getModules();
         if(!is_array($list_modules))$list_modules=array();
		 foreach($list_modules as $url => $name)
		 {
		      $add    = $permission[$url]['add'];
              $edit   = $permission[$url]['edit'];
              $del    = $permission[$url]['del'];
		  ?>
		  <tr>
			<td style="padding-left:5" nowrap="nowrap"><b><? echo $name?></b>&nbsp;</td>
			<td align="center">
                <input type="hidden" name="listname[]" value="<?php echo $url?>" />
                <input type="checkbox" name="<?php echo $url?>[]"  value="1" class="peradd"	<? if($add>0){echo "checked";}?>/>
            </td>
            <td align="center">
			     <input type="checkbox" name="<?php echo $url?>[]" value="2" class="peredit" <? if($edit>0)echo "checked";?> />
			</td>
            <td align="center">
			     <input type="checkbox" name="<?php echo $url?>[]" value="4" class="perdel" <? if($del>0)echo "checked";?> />
			</td>
		</tr>
		 <?php
		 }
		 ?>
   </table>
</form>
</div>
<script>
function checkall(cla,ali)
{
    if(ali.checked==true)
    {
        ali.checked=false;
    }else
    {
        ali.checked=true;
    }
    for(i in $ES(".per"+cla))
    {
        var elob=$ES(".per"+cla)[i];
        elob.checked=ali.checked;
    }
}
</script>